home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Development / PowerD / Pdmod / modules / net / if_arp.m < prev    next >
Encoding:
Text File  |  2002-10-28  |  4.5 KB  |  112 lines

  1. /*
  2. **      $Filename: net/if_arp.h $
  3. **      $Release$
  4. **      $Revision: 3.1 $
  5. **      $Date: 1994/02/03 19:18:17 $
  6. **
  7. **      Interface to the Address Resolution Protocol
  8. **
  9. **      Copyright © 1993,1994 AmiTCP/IP Group, <AmiTCP-Group@hut.fi>
  10. **                  Helsinki University of Technology, Finland.
  11. **                  All rights reserved.
  12. */
  13.  
  14. /*
  15.  * Address Resolution Protocol.
  16.  *
  17.  * See RFC 826 for protocol description.  ARP packets are variable
  18.  * in size; the arphdr structure defines the fixed-length portion.
  19.  * Protocol type values are the same as those for 10 Mb/s Ethernet.
  20.  * It is followed by the variable-sized fields ar_sha, arp_spa,
  21.  * arp_tha and arp_tpa in that order, according to the lengths
  22.  * specified.  Field names used correspond to RFC 826.
  23.  */
  24. #define ARPHRD_ETHER    1       /* ethernet hardware address */
  25. #define ARPHRD_ARCNET   7       /* ARCNET hardware address */
  26.  
  27. #define ARPOP_REQUEST   1       /* request to resolve address */
  28. #define ARPOP_REPLY     2       /* response to previous request */
  29.  
  30. OBJECT arphdr
  31.     ar_hrd:UWORD,         /* format of hardware address */
  32.     ar_pro:UWORD,         /* format of protocol address */
  33.     ar_hln:UBYTE,         /* length of hardware address */
  34.     ar_pln:UBYTE,         /* length of protocol address */
  35.     ar_op:UWORD          /* one of: */
  36. /*
  37.  * The remaining fields are variable in size,
  38.  * according to the sizes above.
  39.  */
  40. /*      u_char  ar_sha[];       \* sender hardware address */
  41. /*      u_char  ar_spa[];       \* sender protocol address */
  42. /*      u_char  ar_tha[];       \* target hardware address */
  43. /*      u_char  ar_tpa[];       \* target protocol address */
  44.  
  45. #define MAXADDRARP  16          /* Maximum number of octets in hw address */
  46.  
  47. /*
  48.  * ARP ioctl request. 
  49.  */
  50. OBJECT arpreq
  51.     arp_pa:sockaddr,                /* protocol address */
  52.     OBJECT arp_ha                           /* hardware address */
  53.         sa_len:UBYTE,
  54.         sa_family:UBYTE,
  55.         sa_data[MAXADDRARP]:BYTE
  56.     ENDOBJECT,
  57.     arp_flags:ULONG                      /* flags */
  58.  
  59.  
  60. /*  arp_flags and at_flags field values */
  61. #define ATF_INUSE       $01    /* entry in use */
  62. #define ATF_COM         $02    /* completed entry (enaddr valid) */
  63. #define ATF_PERM        $04    /* permanent entry */
  64. #define ATF_PUBL        $08    /* publish entry (respond for other host) */
  65. #define ATF_USETRAILERS $10    /* has requested trailers */
  66.  
  67. /* 
  68.  * An AmiTCP/IP specific ARP table ioctl request
  69.  */
  70. OBJECT arptabreq
  71.     atr_arpreq:arpreq, /* We want to identify the interface */
  72.     atr_size:LONG,          /* # of elements in art_table */
  73.     atr_inuse:LONG,               /* # of elements in use */
  74.     atr_table:PTR TO arpreq
  75. /*
  76.  * Copyright (c) 1986 Regents of the University of California.
  77.  * All rights reserved.
  78.  *
  79.  * Redistribution and use in source and binary forms, with or without
  80.  * modification, are permitted provided that the following conditions
  81.  * are met:
  82.  * 1. Redistributions of source code must retain the above copyright
  83.  *    notice, this list of conditions and the following disclaimer.
  84.  * 2. Redistributions in binary form must reproduce the above copyright
  85.  *    notice, this list of conditions and the following disclaimer in the
  86.  *    documentation and/or other materials provided with the distribution.
  87.  * 3. All advertising materials mentioning features or use of this software
  88.  *    must display the following acknowledgement:
  89.  *      This product includes software developed by the University of
  90.  *      California, Berkeley and its contributors.
  91.  * 4. Neither the name of the University nor the names of its contributors
  92.  *    may be used to endorse or promote products derived from this software
  93.  *    without specific prior written permission.
  94.  *
  95.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  96.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  97.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  98.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  99.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  100.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  101.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  102.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  103.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  104.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  105.  * SUCH DAMAGE.
  106.  *
  107.  *      @(#)if_arp.h    7.4 (Berkeley) 6/28/90
  108.  */
  109.  
  110.  
  111.  
  112.